<script type="text/javascript">
    function vToggleMonth(el) {
        var elId = $(el).attr('id');
        
        if ($(el).hasClass('plus')) {
            $(el).removeClass('plus');
            $(el).addClass('moins');            
            $('#tabssynthese .'+elId).each(function(){
                $(this).fadeIn('fast');
                if($(this).hasClass('keepHide')) {
                    $(this).hide();
                }
            });
        } else if ($(el).hasClass('moins')) {
            $(el).removeClass('moins');
            $(el).addClass('plus');
            $('#tabssynthese .'+elId).fadeOut('fast'); 
        }
    }
    
    function vToggleSemaine(el) {
        var elId = $(el).attr('id');
        
        if ($(el).hasClass('plus')) {
            $(el).removeClass('plus');
            $(el).addClass('moins');            
            $('#tabssynthese .'+elId).fadeIn('fast');
            $('#tabssynthese .'+elId).addClass('keepShow');
            $('#tabssynthese .'+elId).removeClass('keepHide');
            $('#tabssynthese .'+elId).removeClass('hide');
        } else if ($(el).hasClass('moins')) {
            $(el).removeClass('moins');
            $(el).addClass('plus');
            $('#tabssynthese .'+elId).fadeOut('fast');   
            $('#tabssynthese .'+elId).addClass('keepHide');
            $('#tabssynthese .'+elId).removeClass('keepShow');
        }
    }
</script>
<?php // var_dump($request); ?>
<div id="tabssynthese">
    <table style="border-collapse: separate; border-spacing: 1px;">
        <tr class="rowTop">
            <th class="th-empty"></th>
            <th class="ca">CA TTC</th>
            <th class="ca">CA HT</th>
            
            <th class="vtva"><nobr>CA TTC</nobr><br>TVA1</th>
            <th class="vtva"><nobr>CA TTC</nobr><br>TVA2</th>
            <th class="vtva"><nobr>CA TTC</nobr><br>TVA3</th>
            
            <th class="vmp"><nobr>CA TTC</nobr><br>CB</th>
            <th class="vmp"><nobr>CA TTC</nobr><br>Espèces</th>
            <th class="vmp"><nobr>CA TTC</nobr><br>Amex</th>
            <th class="vmp"><nobr>CA TTC</nobr><br>Jcb</th>
            <th class="vmp"><nobr>CA TTC</nobr><br>Autres</th>
            <th class="vmp"><nobr>CA TTC</nobr><br>Chèque</th>
            <th class="vmp"><nobr>CA TTC</nobr><br>ChèqueV</th>
            <th class="vmp"><nobr>CA TTC</nobr><br>TR</th>
            <th class="vmp"><nobr>CA TTC</nobr><br>RetroFlash</th>
            
            <th class="hide cc">Compte<br /><nobr>clients</nobr></th>

            <th class="hide rbcrt">Remise<br />Banque</th>
            <th class="hide rbcrt">Remise<br />CRT</th>
            
            <th class="ea">Annulation<br />qté</th>
            <th class="ea">Annulation<br />montant</th>
            <th class="ea"><nobr>Tickets signés</nobr><br />qté</th>
            <th class="ea"><nobr>Tickets signés</nobr><br />montant</th>
            <th class="ea">Ecarts<br />montant</th>
            <th class="ea">Ecarts<br />% CA</th>
            <th class="ea">Ecarts<br />nombre</th>
            <th class="ea">Commentaire</th>
            
            <th class="hide spc">Sortie<br />caisse</th>
            <th class="hide spc">Commentaire</th>
            
            <th class="ie">Transactions</th>
            <th class="ie">Ticket<br />moyen</th>
            <th class="ie">Nbre<br />articles</th>
            <th class="ie">Taux<br />prise</th>
            
            <th class="hide mba">Alimentaire</th>
            <th class="hide mba">Alimentaire<br />(%)</th>
            <th class="hide mba">Emballage</th>
            <th class="hide mba">Emballage<br />(%)</th>
            <th class="hide mba">Marge<br />brute</th>
            <th class="hide mba">Marge<br />brute(%)</th>
            
            <th class="mo"><nobr>MO totale</nobr></th>
            <th class="mo"><nobr>MO totale(%)</nobr></th>
            <th class="mo">Nbre<br />heure</th>
            <th class="mo">Productivité</th>
            <th class="mo">Transfert<br />entrant</th>
            <th class="mo">Transfert<br />sortant</th>
            
            <th class="pro">Pertes</th>
            <th class="pro">Pertes<br />(%)</th>
            <th class="pro">Repas</th>
            <th class="pro">Repas<br />(%)</th>
            <th class="pro">Offerts</th>
            <th class="pro">Offerts<br />(%)</th>
            
            <th class="mt">Ensoleil-<br>lement</th>
            <th class="mt">T°</th>
        </tr>
    <?php    
    // Boucle sur les mois
    $cmonth = 0;
    $countmonth = 1;
    $nbmonth = count($period);    
    foreach ($period as $idxm => $month) {
        $monthExpload = explode(" ", $idxm);
        $monthName = $monthExpload[0];
        switch ($monthName) {
            case 'Janvier':
                $monthIdx = $monthExpload[1].'-01';
                break;
            case 'Février':
                $monthIdx = $monthExpload[1].'-02';
                break;
            case 'Mars':
                $monthIdx = $monthExpload[1].'-03';
                break;
            case 'Avril':
                $monthIdx = $monthExpload[1].'-04';
                break;
            case 'Mai':
                $monthIdx = $monthExpload[1].'-05';
                break;
            case 'Juin':
                $monthIdx = $monthExpload[1].'-06';
                break;
            case 'Juillet':
                $monthIdx = $monthExpload[1].'-07';
                break;
            case 'Août':
                $monthIdx = $monthExpload[1].'-08';
                break;
            case 'Septembre':
                $monthIdx = $monthExpload[1].'-09';
                break;
            case 'Octobre':
                $monthIdx = $monthExpload[1].'-10';
                break;
            case 'Novembre':
                $monthIdx = $monthExpload[1].'-11';
                break;
            case 'Décembre':
                $monthIdx = $monthExpload[1].'-12';
                break;

            default:
                break;
        }

        if($echoMonthtoEn[$monthName] == date("F")) {
            $plus_moins = "moins";
            $cmonth = 1;
        } else {
            $plus_moins = "plus";
        }
        
        // Déballe le dernier mois si le mois en cours n'est pas sélectionné
        if($cmonth == 0 && $countmonth == $nbmonth) {
            $plus_moins = "moins";
        }
        
        $monthTxPrise = 0;
        if($monthData[$monthIdx]['nbT'] > 0)
            $monthTxPrise = $monthData[$monthIdx]['nbA']/$monthData[$monthIdx]['nbT'];
        
        $monthTm = 0;
        if($monthData[$monthIdx]['nbT'] > 0)
            $monthTm = $monthData[$monthIdx]['ca_ttc']/$monthData[$monthIdx]['nbT'];
        
        echo '
            <tr class="rowMonth">
                <td class="monthItem">
                    <p onclick="vToggleMonth($(this).children());">
                        <span id="rpm'.$monthName.'" class="vtoogle '.$plus_moins.'"></span>'.$idxm.'
                    </p>
                </td>
                <td class="ca topicMonthValue">'.number_format($monthData[$monthIdx]['ca_ttc'],2,',', ' ').'</td>
                <td class="ca topicMonthValue">'.number_format($monthData[$monthIdx]['ca_ht'],2,',', ' ').'</td>
                
                <td class="vtva topicMonthValue">'.number_format($monthData[$monthIdx]['txreduit1'],2,',', ' ').'</td>
                <td class="vtva topicMonthValue">'.number_format($monthData[$monthIdx]['txreduit2'],2,',', ' ').'</td>
                <td class="vtva topicMonthValue">'.number_format($monthData[$monthIdx]['txnormal'],2,',', ' ').'</td>
                
                <td class="vmp topicMonthValue">'.number_format($monthData[$monthIdx]['cb'],2,',', ' ').'</td>
                <td class="vmp topicMonthValue">'.number_format($monthData[$monthIdx]['espece'],2,',', ' ').'</td>
                <td class="vmp topicMonthValue"></td>
                <td class="vmp topicMonthValue"></td>
                <td class="vmp topicMonthValue"></td>
                <td class="vmp topicMonthValue">'.number_format($monthData[$monthIdx]['cheque'],2,',', ' ').'</td>
                <td class="vmp topicMonthValue"></td>
                <td class="vmp topicMonthValue">'.number_format($monthData[$monthIdx]['tr'],2,',', ' ').'</td>
                <td class="vmp topicMonthValue"></td>
                
                <td class="hide cc topicMonthValue"></td>
                
                <td class="hide rbcrt topicMonthValue"></td>
                <td class="hide rbcrt topicMonthValue"></td>
                
                <td class="ea topicMonthValue">'.number_format($monthData[$monthIdx]['ac'],0,',', ' ').'</td>
                <td class="ea topicMonthValue">'.number_format($monthData[$monthIdx]['mac'],2,',', ' ').'</td>
                <td class="ea topicMonthValue"></td>
                <td class="ea topicMonthValue"></td>
                <td class="ea topicMonthValue">'.number_format($monthData[$monthIdx]['ec'],2,',', ' ').'</td>
                <td class="ea topicMonthValue"></td>
                <td class="ea topicMonthValue"></td>
                <td class="ea topicMonthValue"></td>
                
                <td class="hide spc topicMonthValue"></td>
                <td class="hide spc topicMonthValue"></td>
                
                <td class="ie topicMonthValue">'.number_format($monthData[$monthIdx]['nbT'],0,',', ' ').'</td>
                <td class="ie topicMonthValue">'.number_format($monthTm,2,',', ' ').'</td>
                <td class="ie topicMonthValue">'.number_format($monthData[$monthIdx]['nbA'],0,',', ' ').'</td>
                <td class="ie topicMonthValue">'.number_format($monthTxPrise,2,',', ' ').'</td>
                
                <td class="hide mba topicMonthValue"></td>
                <td class="hide mba topicMonthValue"></td>
                <td class="hide mba topicMonthValue"></td>
                <td class="hide mba topicMonthValue"></td>
                <td class="hide mba topicMonthValue"></td>
                <td class="hide mba topicMonthValue"></td>
                
                <td class="mo topicMonthValue"></td>
                <td class="mo topicMonthValue"></td>
                <td class="mo topicMonthValue"></td>
                <td class="mo topicMonthValue"></td>
                <td class="mo topicMonthValue"></td>
                <td class="mo topicMonthValue"></td>
                
                <td class="pro topicMonthValue"></td>
                <td class="pro topicMonthValue"></td>
                <td class="pro topicMonthValue">'.number_format($monthData[$monthIdx]['repas'],0,',', ' ').'</td>
                <td class="pro topicMonthValue"></td>
                <td class="pro topicMonthValue"></td>
                <td class="pro topicMonthValue"></td>
                
                <td class="mt topicMonthValue"></td>
                <td class="mt topicMonthValue"></td>
            </tr>';

        // Boucle sur les semaines
        $y = 1; 
        $nbweek = count($month);
        foreach ($month as $idxw => $week) {
            if($echoMonthtoEn[$monthName] == date("F") && $idxw == date("W")) {
                $plus_moins = "moins";
                $hide = "";
            } elseif($echoMonthtoEn[$monthName] == date("F")) {
                $plus_moins = "plus";
                $hide = "";
            } else {
                $plus_moins = "plus";
                $hide = "hide";
            }
            
            // Déballe la dernière semaine du dernier mois si le mois en cours n'est pas sélectionné
            if($cmonth == 0 && $countmonth == $nbmonth && $y == $nbweek) {
                $plus_moins = "moins";
                $hide = "";
            } elseif($cmonth == 0 && $countmonth == $nbmonth && $y != $nbweek)  {
                $plus_moins = "plus";
                $hide = "";
            } elseif($cmonth == 0 && $countmonth != $nbmonth && $y != $nbweek) {
                $plus_moins = "plus";
                $hide = "hide";
            }
            
            $weekTxPrise = 0;
            if($weekData[$monthIdx][$idxw]['nbT'] > 0)
                $weekTxPrise = $weekData[$monthIdx][$idxw]['nbA']/$weekData[$monthIdx][$idxw]['nbT'];
            
            $weekTm = 0;
            if($weekData[$monthIdx][$idxw]['nbT'] > 0)
                $weekTm = $weekData[$monthIdx][$idxw]['ca_ttc']/$weekData[$monthIdx][$idxw]['nbT'];
                
            echo '
                <tr class="'.$hide.' rpm'.$monthName.'">
                    <td class="weekItem">
                        <p onclick="vToggleSemaine($(this).children());">
                            <span id="rps'.$monthName.$idxw.'" class="vtoogle '.$plus_moins.'"></span>Semaine '.$y.'
                        </p>
                    </td>
                    <td class="ca topicWeekValue">'.number_format($weekData[$monthIdx][$idxw]['ca_ttc'],2,',', ' ').'</td>
                    <td class="ca topicWeekValue">'.number_format($weekData[$monthIdx][$idxw]['ca_ht'],2,',', ' ').'</td>
                    
                    <td class="vtva topicWeekValue">'.number_format($weekData[$monthIdx][$idxw]['txreduit1'],2,',', ' ').'</td>
                    <td class="vtva topicWeekValue">'.number_format($weekData[$monthIdx][$idxw]['txreduit2'],2,',', ' ').'</td>
                    <td class="vtva topicWeekValue">'.number_format($weekData[$monthIdx][$idxw]['txnormal'],2,',', ' ').'</td>

                    <td class="vmp topicWeekValue">'.number_format($weekData[$monthIdx][$idxw]['cb'],2,',', ' ').'</td>
                    <td class="vmp topicWeekValue">'.number_format($weekData[$monthIdx][$idxw]['espece'],2,',', ' ').'</td>
                    <td class="vmp topicWeekValue"></td>
                    <td class="vmp topicWeekValue"></td>
                    <td class="vmp topicWeekValue"></td>
                    <td class="vmp topicWeekValue">'.number_format($weekData[$monthIdx][$idxw]['cheque'],2,',', ' ').'</td>
                    <td class="vmp topicWeekValue"></td>
                    <td class="vmp topicWeekValue">'.number_format($weekData[$monthIdx][$idxw]['tr'],2,',', ' ').'</td>
                    <td class="vmp topicWeekValue"></td>
                    
                    <td class="hide cc topicWeekValue"></td>
                    
                    <td class="hide rbcrt topicWeekValue"></td>
                    <td class="hide rbcrt topicWeekValue"></td>
                    
                    <td class="ea topicWeekValue">'.number_format($weekData[$monthIdx][$idxw]['ac'],0,',', ' ').'</td>
                    <td class="ea topicWeekValue">'.number_format($weekData[$monthIdx][$idxw]['mac'],2,',', ' ').'</td>
                    <td class="ea topicWeekValue"></td>
                    <td class="ea topicWeekValue"></td>
                    <td class="ea topicWeekValue">'.number_format($weekData[$monthIdx][$idxw]['ec'],2,',', ' ').'</td>
                    <td class="ea topicWeekValue"></td>
                    <td class="ea topicWeekValue"></td>
                    <td class="ea topicWeekValue"></td>
                    
                    <td class="hide spc topicWeekValue"></td>
                    <td class="hide spc topicWeekValue"></td>
                    
                    <td class="ie topicWeekValue">'.number_format($weekData[$monthIdx][$idxw]['nbT'],0,',', ' ').'</td>
                    <td class="ie topicWeekValue">'.number_format($weekTm,2,',', ' ').'</td>
                    <td class="ie topicWeekValue">'.number_format($weekData[$monthIdx][$idxw]['nbA'],0,',', ' ').'</td>
                    <td class="ie topicWeekValue">'.number_format($weekTxPrise,2,',', ' ').'</td>
                    
                    <td class="hide mba topicWeekValue"></td>
                    <td class="hide mba topicWeekValue"></td>
                    <td class="hide mba topicWeekValue"></td>
                    <td class="hide mba topicWeekValue"></td>
                    <td class="hide mba topicWeekValue"></td>
                    <td class="hide mba topicWeekValue"></td>
                    
                    <td class="mo topicWeekValue"></td>
                    <td class="mo topicWeekValue"></td>
                    <td class="mo topicWeekValue"></td>
                    <td class="mo topicWeekValue"></td>
                    <td class="mo topicWeekValue"></td>
                    <td class="mo topicWeekValue"></td>
                    
                    <td class="pro topicWeekValue"></td>
                    <td class="pro topicWeekValue"></td>
                    <td class="pro topicWeekValue">'.number_format($weekData[$monthIdx][$idxw]['repas'],0,',', ' ').'</td>
                    <td class="pro topicWeekValue"></td>
                    <td class="pro topicWeekValue"></td>
                    <td class="pro topicWeekValue"></td>
                    
                    <td class="mt topicWeekValue"></td>
                    <td class="mt topicWeekValue"></td>
                </tr>';

            // Boucle sur les jours
            foreach ($week as $idxd => $day) {                
                $lDayItem_class = "other-day-item";
                $rDayItem_class = "topicDayValue";
                
                if($echoMonthtoEn[$monthName] == date("F") && $idxw == date("W"))
                    $hide = "keepShow";
                else
                    $hide = "keepHide hide";
                
                // Déballe la dernière semaine du dernier mois si le mois en cours n'est pas sélectionné
                if($cmonth == 0 && $countmonth == $nbmonth && $y == $nbweek) {
                    $hide = "keepShow";
                } elseif($cmonth == 0 && $countmonth == $nbmonth && $y != $nbweek)  {
                    $hide = "keepHide hide";
                } elseif($cmonth == 0 && $countmonth != $nbmonth && $y != $nbweek) {
                    $hide = "keepHide hide";
                }

                // Get CA for each day
                $ca_ttc = $ca_ht =0;
                foreach($ca as $ca_day):
                    if($day->format('Y-m-d')==$ca_day['orderDate']){
                        $ca_ttc = $ca_day['ca_ttc'];
                        $ca_ht = $ca_day['ca_ht'];
                    }
                endforeach;

                // Get TM for each day
                $nb = $val = $nbC = $valC = $nbE = $valE = 0;
                foreach($tm as $tm_day):
                    if($day->format('Y-m-d')==$tm_day['orderDate']){                        
                        $nb += @$tm_day['nombre'];
                        $val += @$tm_day['valeur'];
//                        if($tm_day['type'] == 'C'){                        
//                            $nbC += @$tm_day['nombre'];
//                            $valC += @$tm_day['valeur'];
//                        }
//                        if($tm_day['type'] == 'E'){                        
//                            $nbE += @$tm_day['nombre'];
//                            $valE += @$tm_day['valeur'];
//                        }
                    }
                endforeach;
                $tm_ttc = ($nb!=0)?($val/$nb):0;
//                $c_tm_ttc = ($nbC!=0)?($valC/$nbC):0;
//                $e_tm_ttc = ($nbE!=0)?($valE/$nbE):0;

                // Get nbT for each day
                 $nbTra = 0;
                foreach($nbT as $nbT_day):
                    if($day->format('Y-m-d')==$nbT_day['orderDate']){
                        $nbTra = ($nbT_day['nbTransaction']!=0)?$nbT_day['nbTransaction']:0;
                    }
                endforeach;

                // Get nbA for each day
                $nbArt = 0; 
                foreach($nbA as $nbA_day):
                    if($day->format('Y-m-d')==$nbA_day['orderDate']){
                        $nbArt = ($nbA_day['nbArticle']!=0)?$nbA_day['nbArticle']:0;
                    }
                endforeach;
                
                // Get Taux de prise
                $tx = 0;
                if($nbTra > 0)
                    $tx = $nbArt/$nbTra;
                
                // Get AnnulationCaisse for each day
                $nbAc = $mtAc= 0;
                foreach($ac as $ac_day):
                    if($day->format('Y-m-d')==$ac_day['orderDate']){
                        $nbAc = ($ac_day['ac']!=0)?$ac_day['ac']:0;
                        $mtAc = ($ac_day['montant_ac']!=0)?$ac_day['montant_ac']:0;
                    }
                endforeach;

                // Get meteo for each day
                $meteo = "&nbsp;";
                $temperature = "&nbsp;";
                foreach($meteoDays as $meteoDay){                                                                        
                    if($day->format('Y-m-d')==$meteoDay['meteoDate']){                                        
                        $meteo = $meteoDay['type'];
                        $temperature = number_format($meteoDay['temperature'],1,',', ' ');
                    }
                }

                // Get ecarts caisse for each day
                $ec = 0; 
                foreach($ecDays as $ec_day):
                    if($day->format('Y-m-d')==$ec_day['date']){
                        $ec = ($ec_day['ec']!=0)?$ec_day['ec']:0;
                    }
                endforeach;
                
                // Get MO for each day
                $mo = 0; 
                foreach($rhdata as $data):
                    if($day->format('Y-m-d')==$data['date']){
                        $mo = ($data['mo']!=0)?$data['mo']:0;
                    }
                endforeach;
                
                // Get Hours for each day
                $nbh = 0; 
                foreach($rhdata as $data):
                    if($day->format('Y-m-d')==$data['date']){
                        $nbh = ($data['nbh']!=0)?$data['nbh']:0;
                    }
                endforeach;
                
                // Get Productivity for each day
                $prod = 0; 
                foreach($rhdata as $data):
                    if($day->format('Y-m-d')==$data['date']){
                        $prod = ($data['prod']!=0)?$data['prod']:0;
                    }
                endforeach;
                
                // Get Transfert input for each day
                $te = 0; 
                foreach($rhdata as $data):
                    if($day->format('Y-m-d')==$data['date']){
                        $te = ($data['te']!=0)?$data['te']:0;
                    }
                endforeach;
                
                // Get Transfert output for each day
                $ts = 0; 
                foreach($rhdata as $data):
                    if($day->format('Y-m-d')==$data['date']){
                        $ts = ($data['ts']!=0)?$data['ts']:0;
                    }
                endforeach;

                // Get meal count for each day
                $repas = 0;
                foreach($repasDays as $repas_day):
                    if($day->format('Y-m-d')==$repas_day['orderDate']){
                        $repas = ($repas_day['repas']!=0)?$repas_day['repas']:0;
                    }
                endforeach;
                
                // Get payment ventilation for each day
                $cb = $espece = $cheque = $tr = 0;
                foreach($banque as $banque_day):
                    if($day->format('Y-m-d')==$banque_day['date']){
                        $cb = ($banque_day['cb']!=0)?$banque_day['cb']:0;
                        $cheque = ($banque_day['cheque']!=0)?$banque_day['cheque']:0;
                        $espece = ($banque_day['espece']!=0)?$banque_day['espece']:0;
                        $tr = ($banque_day['tr']!=0)?$banque_day['tr']:0;
                    }
                endforeach;
                
                // Get tva ventilation for each day
                $txreduit1 = $txreduit2 = $txnormal = 0;
                foreach($vtva as $vtva_day):
                    if($day->format('Y-m-d')==$vtva_day['orderDate']){
                        if($vtva_day['taxeRate']==5.5){
                            $txreduit1 = $vtva_day['ca_ttc'];
                        }
                        if($vtva_day['taxeRate']==7 || $vtva_day['taxeRate']==10){
                            $txreduit2 = $vtva_day['ca_ttc'];
                        }
                        if($vtva_day['taxeRate']==19.6 || $vtva_day['taxeRate']==20){
                            $txnormal = $vtva_day['ca_ttc'];
                        }
                    }
                endforeach;

                if($idxd == "dimanche") {
                    $lDayItem_class = "sunday-day-item";
                }
                
                $daynum = ($day->format('N')==7)?0:$day->format('N');
                if(in_array($daynum, $request->semaine)):
                echo '
                    <tr class="'.$hide.' rpm'.$monthName.' rps'.$monthName.$idxw.'">
                        <td>
                            <table>
                                <tr>
                                    <td style="width:50%" class="'.$lDayItem_class.'">'.$idxd.'</td>
                                    <td style="width:50%" class="'.$lDayItem_class.'">'.$day->format('d-M-y').'</td>
                                </tr>
                            </table>
                        </td>
                        <td class="ca '.$rDayItem_class.'">'.number_format($ca_ttc,2,',', ' ').'</td>
                        <td class="ca '.$rDayItem_class.'">'.number_format($ca_ht,2,',', ' ').'</td>
                            
                        <td class="vtva '.$rDayItem_class.'">'.number_format($txreduit1,2,',', ' ').'</td>
                        <td class="vtva '.$rDayItem_class.'">'.number_format($txreduit2,2,',', ' ').'</td>
                        <td class="vtva '.$rDayItem_class.'">'.number_format($txnormal,2,',', ' ').'</td>

                        <td class="vmp '.$rDayItem_class.'">'.number_format($cb,2,',', ' ').'</td>
                        <td class="vmp '.$rDayItem_class.'">'.number_format($espece,2,',', ' ').'</td>
                        <td class="vmp '.$rDayItem_class.'">&nbsp;</td>
                        <td class="vmp '.$rDayItem_class.'">&nbsp;</td>
                        <td class="vmp '.$rDayItem_class.'">&nbsp;</td>
                        <td class="vmp '.$rDayItem_class.'">'.number_format($cheque,2,',', ' ').'</td>
                        <td class="vmp '.$rDayItem_class.'">&nbsp;</td>
                        <td class="vmp '.$rDayItem_class.'">'.number_format($tr,2,',', ' ').'</td>
                        <td class="vmp '.$rDayItem_class.'">&nbsp;</td>
                            
                        <td class="hide cc '.$rDayItem_class.'">&nbsp;</td>
                            
                        <td class="hide rbcrt '.$rDayItem_class.'">&nbsp;</td>
                        <td class="hide rbcrt '.$rDayItem_class.'">&nbsp;</td>
                            
                        <td class="ea '.$rDayItem_class.'">'.number_format($nbAc,0,',', ' ').'</td>
                        <td class="ea '.$rDayItem_class.'">'.number_format($mtAc,2,',', ' ').'</td>
                        <td class="ea '.$rDayItem_class.'">&nbsp;</td>
                        <td class="ea '.$rDayItem_class.'">&nbsp;</td>
                        <td class="ea '.$rDayItem_class.'">'.number_format($ec,2,',', ' ').'</td>
                        <td class="ea '.$rDayItem_class.'">&nbsp;</td>
                        <td class="ea '.$rDayItem_class.'">&nbsp;</td>
                        <td class="ea '.$rDayItem_class.'">&nbsp;</td>
                            
                        <td class="hide spc '.$rDayItem_class.'">&nbsp;</td>
                        <td class="hide spc '.$rDayItem_class.'">&nbsp;</td>
                            
                        <td class="ie '.$rDayItem_class.'">'.number_format($nbTra,0,',', ' ').'</td>
                        <td class="ie '.$rDayItem_class.'">'.number_format($tm_ttc,2,',', ' ').'</td>
                        <td class="ie '.$rDayItem_class.'">'.number_format($nbArt,0,',', ' ').'</td>
                        <td class="ie '.$rDayItem_class.'">'.number_format($tx,2,',', ' ').'</td>
                            
                        <td class="hide mba '.$rDayItem_class.'">&nbsp;</td>
                        <td class="hide mba '.$rDayItem_class.'">&nbsp;</td>
                        <td class="hide mba '.$rDayItem_class.'">&nbsp;</td>
                        <td class="hide mba '.$rDayItem_class.'">&nbsp;</td>
                        <td class="hide mba '.$rDayItem_class.'">&nbsp;</td>
                        <td class="hide mba '.$rDayItem_class.'">&nbsp;</td>
                            
                        <td class="mo '.$rDayItem_class.'">'.number_format($mo,2,',', ' ').'</td>
                        <td class="mo '.$rDayItem_class.'">&nbsp;</td>
                        <td class="mo '.$rDayItem_class.'">'.number_format($nbh,2,',', ' ').'</td>
                        <td class="mo '.$rDayItem_class.'">'.number_format($prod,2,',', ' ').'</td>
                        <td class="mo '.$rDayItem_class.'">'.number_format($te,2,',', ' ').'</td>
                        <td class="mo '.$rDayItem_class.'">'.number_format($ts,2,',', ' ').'</td>
                                
                        <td class="pro '.$rDayItem_class.'">&nbsp;</td>
                        <td class="pro '.$rDayItem_class.'">&nbsp;</td>
                        <td class="pro '.$rDayItem_class.'">'.number_format($repas,0,',', ' ').'</td>
                        <td class="pro '.$rDayItem_class.'">&nbsp;</td>
                        <td class="pro '.$rDayItem_class.'">&nbsp;</td>
                        <td class="pro '.$rDayItem_class.'">&nbsp;</td>
                        
                        <td class="mt '.$rDayItem_class.'">'.$meteo.'</td>
                        <td class="mt '.$rDayItem_class.'">'.$temperature.'</td>
                    </tr>';
                endif;
            }
            $y++;
        }
        $countmonth++;
    }
    ?>
    </table>
</div>